﻿@model IEnumerable<MvcMSFootball.Models.Player>

@{
    ViewBag.Title = "IndexList";
}

<h2>Players</h2>

<p>
    @Html.ActionLink("Create New", "Create")

    @using (Html.BeginForm()){    
        <p>
        *Try filtering with <b>both</b> filters<br/>
           By Team: @Html.DropDownList("teamList", "-teams-")
           By Name: @Html.TextBox("searchString") 
        <input type="submit" value="Filter" /></p> 
    }
</p>
<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Age
        </th>
        <th>
            Team
        </th>
        <th>
            Comments
        </th>
        <th>
            Rating
        </th>
        <th>
            Goals
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Age)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Team.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Comments)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Rating)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Goals)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>
